package com.vcit.system.service.exchangeGrade.impl;

import java.util.List;
import com.vcit.common.utils.DateUtils;
import com.vcit.common.utils.SecurityUtils;
import com.vcit.system.domain.exchangeGrade.TExchangeGrade;

import com.vcit.system.mapper.exchangeGrade.TExchangeGradeMapper;
import com.vcit.system.service.exchangeGrade.ITExchangeGradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 成绩置换Service业务层处理
 * 
 * @author dff
 * @date 2025-01-17
 */
@Service
public class TExchangeGradeServiceImpl implements ITExchangeGradeService
{
    @Autowired
    private TExchangeGradeMapper tExchangeGradeMapper;

    /**
     * 查询成绩置换
     * 
     * @param id 成绩置换主键
     * @return 成绩置换
     */
    @Override
    public TExchangeGrade selectTExchangeGradeById(Long id)
    {
        return tExchangeGradeMapper.selectTExchangeGradeById(id);
    }

    /**
     * 查询成绩置换列表
     * 
     * @param tExchangeGrade 成绩置换
     * @return 成绩置换
     */
    @Override
    public List<TExchangeGrade> selectTExchangeGradeList(TExchangeGrade tExchangeGrade)
    {
        return tExchangeGradeMapper.selectTExchangeGradeList(tExchangeGrade);
    }

    /**
     * 新增成绩置换
     * 
     * @param tExchangeGrade 成绩置换
     * @return 结果
     */
    @Override
    public int insertTExchangeGrade(TExchangeGrade tExchangeGrade)
    {

        tExchangeGrade.setCreateId(SecurityUtils.getUserId());
        tExchangeGrade.setCreateTime(DateUtils.getNowDate());
        return tExchangeGradeMapper.insertTExchangeGrade(tExchangeGrade);
    }

    /**
     * 修改成绩置换
     * 
     * @param tExchangeGrade 成绩置换
     * @return 结果
     */
    @Override
    public int updateTExchangeGrade(TExchangeGrade tExchangeGrade)
    {

        tExchangeGrade.setUpdateTime(DateUtils.getNowDate());

        return tExchangeGradeMapper.updateTExchangeGrade(tExchangeGrade);
    }

    /**
     * 批量删除成绩置换
     * 
     * @param ids 需要删除的成绩置换主键
     * @return 结果
     */
    @Override
    public int deleteTExchangeGradeByIds(Long[] ids)
    {
        return tExchangeGradeMapper.deleteTExchangeGradeByIds(ids);
    }

    /**
     * 删除成绩置换信息
     * 
     * @param id 成绩置换主键
     * @return 结果
     */
    @Override
    public int deleteTExchangeGradeById(Long id)
    {
        return tExchangeGradeMapper.deleteTExchangeGradeById(id);
    }
}
